Skip to content

perf(linalg): run SiLU on a dedicated AVX-512 kernel - #2589

Draft
cverrier wants to merge 2 commits into
sonos:mainfrom
cverrier:perf/run-silu-on-dedicated-avx512-kernel
Draft

perf(linalg): run SiLU on a dedicated AVX-512 kernel#2589
cverrier wants to merge 2 commits into
sonos:mainfrom
cverrier:perf/run-silu-on-dedicated-avx512-kernel

Conversation

@cverrier

@cverrier cverrier commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

AVX-512 hosts ran SiLU through the 256-bit FMA kernel for both f32 and f16. A 16-wide kernel is faster on both, worth ~8% on f32 buffers and ~29% on f16 — the latter only once the f16 wrapper hands it a slice long enough to amortize the fixed cost every f32 kernel call pays regardless of its length.

Ready for review once #2567 is merged.

AVX-512 hosts ran silu_f32 and silu_f16 through a kernel composed over
the zmm sigmoid, which pays a scratch copy and an extra traversal that
the fused FMA kernel avoids. They now use the fused kernel at both
widths. The composed kernel has no remaining users, and is removed.
AVX-512 hosts ran SiLU through the 256-bit FMA kernel for both f32 and
f16. A 16-wide kernel is faster on both, worth ~8% on f32 buffers and
~29% on f16 — the latter only once the f16 wrapper hands it a slice long
enough to amortize the fixed cost every f32 kernel call pays regardless
of its length.
@cverrier
cverrier force-pushed the perf/run-silu-on-dedicated-avx512-kernel branch from bc41a8d to 31a36ba Compare August 13, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant